﻿using System;
using System.Collections.Generic;
using Jayden.Dll.Web.HtmlControls.Descriptions;
using Jayden.Dll.Web.HtmlControls.Generics;

namespace Jayden.Dll.Web.HtmlControls
{
	public class Ul : HtmlElement
	{
		public Ul() : base(UlDescription.Instance) { }

		public Li AddLi(string text = null, bool htmlEncode = true) { return AddControl(new Li(text, htmlEncode)) as Li; }
		public Li AddLi(string text, string href, bool htmlEncode = true) { return AddControl(new Li(text, href, htmlEncode)) as Li; }
	}
	public class UlDescription : HtmlElementDescription
	{
		public static readonly UlDescription Instance = new UlDescription();
		private UlDescription() : base("ul") { }
		public override Type ControlType { get { return typeof(Ul); } }
		public override bool IsFlowElement { get { return true; } }
		public override string Description { get { return "unordered list of items; that is, a list in which changing the order of the items would not change the meaning of list."; } }
		public override IEnumerable<HtmlElementDescription> PermittedElements { get { yield return LiDescription.Instance; } }
	}
}
